Automatic Termination Analysis of Programs Containing Arithmetic Predicates

نویسندگان

  • Nachum Dershowitz
  • Naomi Lindenstrauss
  • Yehoshua Sagiv
  • Alexander Serebrenik
چکیده

For logic programs with arithmetic predicates, showing termination is not easy, since the usual order for the integers is not well-founded. A new method, easily incorporated in the TermiLog system for automatic termination analysis, is presented for showing termination in this case. The method consists of the following steps: First, a nite abstract domain for representing the range of integers is deduced automatically. Based on this abstraction, abstract interpretation is applied to the program. The result is a nite number of atoms abstracting answers to queries which are used to extend the technique of query-mapping pairs. For each query-mapping pair that is potentially non-terminating, a bounded (integer-valued) termination function is guessed. If traversing the pair decreases the value of the termination function, then termination is established. Simple functions often su ce for each query-mapping pair, and that gives our approach an edge over the classical approach of using a single termination function for all loops, which must inevitably be more complicated and harder to guess automatically. It is worth noting that the termination of McCarthy's 91 function can be shown automatically using our method. In summary, the proposed approach is based on combining a nite abstraction of the integers with the technique of the query-mapping pairs, and is essentially capable of dividing a termination proof into several cases, such that a simple termination function su ces for each case. Consequently, the whole process of proving c 1999 Published by Elsevier Science B. V.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Termination Analysis of Imperative Programs Using Bitvector Arithmetic

Currently, nearly all methods for proving termination of imperative programs apply an unsound and incomplete abstraction by treating bitvectors and bitvector arithmetic as (unbounded) integers and integer arithmetic, respectively. This abstraction ignores the wraparound behavior caused by underand overflows in bitvector arithmetic operations. This is particularly problematic in the termination ...

متن کامل

Non-termination analysis of logic programs with integer arithmetics

In the past years, analyzers have been introduced to detect classes of non-terminating queries for definite logic programs. Although these non-termination analyzers have shown to be rather precise, their applicability on real-life Prolog programs is limited because most Prolog programs use non-logical features. As a first step towards the analysis of Prolog programs, this paper presents a nonte...

متن کامل

Termination of Narrowing: Automated Proofs and Modularity Properties

In 1936, Alan Turing proved that the halting problem, that is, deciding whether a program terminates, is an undecidable problem for most practical programming languages. Even so, termination is so relevant that a vast number of techniques for proving the termination of programs have been researched in the recent decades. Term rewriting systems provide an abstract theoretical framework ideally s...

متن کامل

Pure, Declarative, and Constructive Arithmetic Relations (Declarative Pearl)

We present decidable logic programs for addition, multiplication, division with remainder, exponentiation, and logarithm with remainder over the unbounded domain of natural numbers. Our predicates represent relations without mode restrictions or annotations. They are fully decidable under the common, DFS-like, SLD resolution strategy of Prolog or under an interleaving refinement of DFS. We prov...

متن کامل

Proving Termination of Programs with Bitvector Arithmetic by Symbolic Execution

In earlier work, we developed an approach for automated termination analysis of C programs with explicit pointer arithmetic, which is based on symbolic execution. However, similar to many other termination techniques, this approach assumed the program variables to range over mathematical integers instead of bitvectors. This eases mathematical reasoning but is unsound in general. In this paper, ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 30  شماره 

صفحات  -

تاریخ انتشار 1999